package sgi.message;

import java.util.Date;
/** Message of inserting all fields to date_time subscription if user is a customer and he didn't subscribe yet  */
@SuppressWarnings("serial")
public class MessageDateTime extends Message {
	private String userName;
	private String location;
	private String qCheckHasSubscription;
	private boolean valid;
	private String notif;
	private String qCountSubscriptions;
	private String qHistory;
	
	public MessageDateTime(String userName, String location) {
		super("select * from customers where username='"+ userName + "'");
		setqCheckHasSubscription("select COUNT(*) from  date_time_subscription where username = '"+ userName + "'");
		this.setUserName(userName);
		this.setLocation(location);
		setqCountSubscriptions("select COUNT(subscription_id) from date_time_subscription");
		setqHistory("INSERT INTO `sgi`.`history_purchase` (`username`, `description`) VALUES ('"+userName+"','Date time subscription Location: "+location+"');");
	}
	public String getLocation() {
		return location;
	}
	public void setLocation(String location) {
		this.location = location;
	}
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public boolean isValid() {
		return valid;
	}
	public void setValid(boolean valid) {
		this.valid = valid;
	}
	public String getNotif() {
		return notif;
	}
	public void setNotif(String notif) {
		this.notif = notif;
	}
	public String getqCheckHasSubscription() {
		return qCheckHasSubscription;
	}
	public void setqCheckHasSubscription(String qCheckHasSubscription) {
		this.qCheckHasSubscription = qCheckHasSubscription;
	}
	public String getqCountSubscriptions() {
		return qCountSubscriptions;
	}
	public void setqCountSubscriptions(String qCountSubscriptions) {
		this.qCountSubscriptions = qCountSubscriptions;
	}
	public String getqHistory() {
		return qHistory;
	}
	public void setqHistory(String qHistory) {
		this.qHistory = qHistory;
	}

}
